Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NEW Typescript Environment with Bun version 1.1.40 #418

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

danhtran94
Copy link

@danhtran94 danhtran94 commented Dec 18, 2024

Typescript Runtime Env without Transpiler

Install Environment:
fission env create --name bun --image ghcr.io/danhtran94/bun-env --builder ghcr.io/danhtran94/bun-builder

Usage:

zip fn-momentprint.zip momentprint.ts package.json
fission package create --env bun --name=fn-momentprint --src fn-momentprint.zip
fission function create --env bun --name fn-momentprint --pkg fn-momentprint --entrypoint "momentprint"
fission function test --name fn-momentprint
Screenshot 2024-12-18 at 10 14 28 PM

momentprint.ts

import momentpackage from "moment";
import type { Request, Response } from "express";

export default (context: { request: Request; response: Response }) => {
  return {
    status: 200,
    body: "Hello " + momentpackage().format(),
  };
};

package.json

{
  "name": "momentprint",
  "devDependencies": {
    "@types/bun": "latest",
    "@types/express": "^5.0.0"
  },
  "peerDependencies": {
    "typescript": "^5.0.0"
  },
  "dependencies": {
    "moment": "^2.30.1"
  }
}

Target Refs
#402
#277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant